package com.hzqx.xxzx.framework.config;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.hzqx.xxzx.framework.oss.OSSClient;
import com.hzqx.xxzx.framework.oss.SimpleOSSClient;

@Configuration
public class OSSConfig {

    //@Value("${aliyun.oss.endpoint}")
    private String endpoint="http://oss-cn-beijing.aliyuncs.com";
    //@Value("${aliyun.oss.accessKey}")
    private String accessKey="LTAI4G64QstpKt9y9bK8iwV8";
    //@Value("${aliyun.oss.secretKey}")
    private String secretKey="VOkSmV6zf16gLseWsLng0GoxBW7GMp";
    //@Value("${aliyun.oss.bucketName}")
    private String bucketName="yzpfirst";
    //@Value("${aliyun.oss.fileBasePath}")
    private String fileBasePath="";
    //这里的基础路径一定是http不能是https，后期自动挂载的时候有用。
//echo "ossfs yzpfirst /oss -ourl=http://oss-cn-beijing.aliyuncs.com -o allow_other" /etc/rc.d/rc.local
//echo yzpfirst:LTAI4G64QstpKt9y9bK8iwV8:VOkSmV6zf16gLseWsLng0GoxBW7GMp > /etc/passwd-ossfs
    @Bean
    public OSSClient ossClient(){
        return new SimpleOSSClient(endpoint,accessKey,secretKey,bucketName,fileBasePath);
    }

}
